package cn.topcodes.tcsf.wechat.service;

import cn.topcodes.tcsf.admin.commons.domain.Page;
import cn.topcodes.tcsf.admin.commons.generic.IGenericService;
import cn.topcodes.tcsf.wechat.domain.entity.WechatUser;
import cn.topcodes.tcsf.wechat.domain.vo.WechatUserVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Unicorn on 2017/10/2.
 */
public interface WechatUserService extends IGenericService<WechatUser> {

    WechatUser findByOpenId(String openId);

    WechatUser findBy(Long wechatMpId, String openId);

    WechatUser findByUnionId(String unionId);

    WechatUser login(String accessToken, String unionId, String openId, String type);

    void syncAllUserFromMp(String mpId);

    void syncAllUserFromMp();

    WechatUser saveWechatUserFromMp(String mpId, String openId);

    WechatUser saveWechatUserFromMp(String openId);

    Page<WechatUserVo> findPage(Long wechatMpId, String nickname, String openId, Integer page, Integer size);
}
